﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>crc</Title>
      <Author>melody</Author>
      <Description>Create relay command</Description>
      <HelpUrl>
      </HelpUrl>
      <Shortcut>crc</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal Editable="true">
          <ID>commandName</ID>
          <ToolTip>commandName</ToolTip>
          <Default>commandName</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>CommandName</ID>
          <ToolTip>CommandName</ToolTip>
          <Default>CommandName</Default>
          <Function>
          </Function>
        </Literal>
      </Declarations>
      <Code Language="csharp" Kind="method decl"><![CDATA[private ICommand $commandName$Command;
public ICommand $CommandName$Command
{
    get
    {
        if (Is$CommandName$CommandNotInitialized())
            Initialize$CommandName$Command();

        return $commandName$Command;
    }
}

private void Initialize$CommandName$Command()
{
    $commandName$Command = new RelayCommand($CommandName$Execute);
}

private bool Is$CommandName$CommandNotInitialized()
{
    return $commandName$Command == null;
}]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>